package ru.amse.tsyganov.jumleditor.properties;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class PropertiesContentProvider 
	implements IStructuredContentProvider {
	
	private PropertiesList propertiesList;
	
	public PropertiesContentProvider(PropertiesList propertiesList) {

		this.propertiesList = propertiesList;
	}

	public void inputChanged(Viewer v, Object oldInput, Object newInput) {
		if (newInput != null) {
			propertiesList = (PropertiesList) newInput;
		}
	}

	public void dispose() {
	}

	public Object[] getElements(Object parent) {
		return propertiesList.getList().toArray();
	}
}


